package com.example.project.dao.impl;

import com.example.project.dao.UserExtDao;
import com.example.project.dao.base.impl.BaseDaoImpl;
import com.example.project.model.bo.UserBo;
import com.example.project.model.jooq.Tables;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2017/12/10.
 */
@Component
public class UserExtDaoImpl extends BaseDaoImpl implements UserExtDao{

    @Override
    public UserBo loadUsersInfo(String account, String password) {
        return this.getDslContext()
                .select(Tables.USERS.fields())
                .from(Tables.USERS)
                .where(Tables.USERS.USER_NAME.eq(account))
                .and(Tables.USERS.USER_PASSWORD.eq(password))
                .fetchOneInto(UserBo.class);
    }
}
